import 'package:flutter/material.dart';
import "package:get/get.dart";

class MyTask extends StatefulWidget {
  const MyTask({super.key});
  @override
  State<MyTask> createState() => _HomePageState();
}

class _HomePageState extends State<MyTask> with SingleTickerProviderStateMixin {
  late TabController _tabController;
  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0xffffffff),
          centerTitle: true,
          leadingWidth: 40,
          title: Text('我的任务',style: TextStyle(fontSize: 16)),
          leading: IconButton(
            onPressed: () {
              Get.back();
              print('object');
            },
            icon: Image.asset('static/images/back.png'),
          ),
        ),
        body: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              // width: 250,
              child: TabBar(
                  indicatorWeight: 3.0,
                  labelPadding: EdgeInsets.symmetric(vertical: 5),
                  indicatorSize: TabBarIndicatorSize.tab,
                 indicatorPadding: EdgeInsets.only(right: 35, left: 35),
                  labelColor: Color(0xff333333),
                  unselectedLabelColor: Color(0xff999999),
                  dividerColor: Colors.transparent,
                  controller: _tabController,
                  overlayColor: WidgetStateProperty.all(Colors.transparent),
                  tabs: [
                    Text(
                      '待审核',
                      style: TextStyle(fontSize: 18),
                    ),
                    Text(
                      '已拒绝',
                      style: TextStyle(fontSize: 18),
                    ),
                    Text(
                      '已通过',
                      style: TextStyle(fontSize: 18),
                    ),
                  ]),
            ),
            Expanded(
              child: ListView(
                children: [
                  for(var item in [])
                  Container(
                    margin: EdgeInsets.symmetric(horizontal: 15),
                    padding: EdgeInsets.all(10),
                    decoration: BoxDecoration(
                        border: Border.all(color: Color(0XFFDDDDDD)),
                        borderRadius: BorderRadius.circular(10)),
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        ClipRRect(
                          borderRadius: BorderRadius.circular(7), // 设置圆角大小
                          child: Image.asset(
                            'static/aaa.png',
                            width: 60,
                            height: 80,
                            fit: BoxFit.fill,
                          ),
                        ),
                        Expanded(
                            child: Padding(
                          padding: EdgeInsets.symmetric(horizontal: 10),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                '策划人要拥有的14张推要拥有的14张要拥有的14张广排期表！高',
                                style: TextStyle(
                                  fontSize: 14,
                                  fontWeight: FontWeight.bold,
                                  overflow: TextOverflow.ellipsis,
                                ),
                              ),
                              SizedBox(
                                height: 5,
                              ),
                              Row(
                                children: [
                                  Container(
                                    padding:
                                        EdgeInsets.symmetric(horizontal: 5),
                                    decoration:
                                        BoxDecoration(color: Color(0XFFF5F5F5)),
                                    child: Text(
                                      '2323人已赚',
                                      style: TextStyle(fontSize: 12),
                                    ),
                                  ),
                                  SizedBox(
                                    width: 10,
                                  ),
                                  Container(
                                    padding:
                                        EdgeInsets.symmetric(horizontal: 5),
                                    decoration:
                                        BoxDecoration(color: Color(0XFFF5F5F5)),
                                    child: Text(
                                      '剩余34个',
                                      style: TextStyle(fontSize: 12),
                                    ),
                                  ),
                                ],
                              ),
                              SizedBox(
                                height: 15,
                              ),
                              Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Row(
                                    children: [
                                      Text(
                                        '+233',
                                        style: TextStyle(
                                            fontSize: 15,
                                            color: Color(0XFFEF0000)),
                                      ),
                                      SizedBox(
                                        width: 5,
                                      ),
                                      Text(
                                        '星币',
                                        style: TextStyle(fontSize: 12),
                                      ),
                                    ],
                                  ),
                                  Text(
                                    '待审核',
                                    style: TextStyle(fontSize: 12),
                                  ),
                                ],
                              )
                            ],
                          ),
                        ))
                      ],
                    ),
                  )
                ],
              ),
            )
          ],
        ));
  }
}
